package com.pp.httpserver;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import com.pp.httpserver.Config.LOG_LEVEL;

public class Testcases {

	static class myRunnable implements Runnable {
		Socket soc;

		public myRunnable(Socket s) {
			soc = s;
		}

		@Override
		public void run() {
			try {
				PrintWriter out =
				        new PrintWriter(soc.getOutputStream(), true);
				BufferedReader in = new BufferedReader(
				        new InputStreamReader(soc.getInputStream()));
				char[] inbuffer = new char[1024];
				StringBuilder instr = new StringBuilder();
				while(in.read(inbuffer) > 0){
					instr.append(inbuffer);
				}
				LLog.log(LOG_LEVEL.HIGH, instr.toString());
				
				
				
				
				
				
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			
		}

	}

	public static void main() {

		LuffyServer ls = new LuffyServer();

		try {
			ServerSocket ss = new ServerSocket(9000);
			Socket client = ss.accept();
			Executor ex = new ThreadPoolExecutor(5, 10, 5, TimeUnit.SECONDS,
					null);
			ex.execute(new Runnable() {
				@Override
				public void run() {

				}
			});
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
